package cn.hquanheng.java_base.javafx;


import javafx.application.Application;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.stage.Stage;

public class App extends Application {
	// stage: 舞台
	@Override
	public void start(Stage stage) throws Exception {
		// 创建按钮
		Button button = new Button("点击我");
		// 事件处理
		EventHandler<ActionEvent> handler = new EventHandler<ActionEvent>() {
			@Override
			public void handle(ActionEvent event) {
				System.out.println("点击...");		
			}
		};
		button.setOnAction(handler);
		// 创建场景
		Scene scene = new Scene(button);

		//
		stage.setScene(scene);
		stage.show();
	}

	public static void main(String[] args) {
		Application.launch(args);
	}

}
